//
//  TestCInterceptor.swift
//  XNavigator_Example
//
//  Created by x on 2024/9/1.
//  Copyright © 2024 CocoaPods. All rights reserved.
//

import XNavigator

class CInterceptor: RouteInterceptor {

    var order: Int { return 1}
    
    func intercept(route: UnionType, completion: @escaping (Bool) -> Void) {
        print("CInterceptor Intercepting route \(route)")
        completion(true)
    }
    
    func willNavigate(to route: UnionType) {
        print("CInterceptor willNavigate \(route)")
    }
    
    func didNavigate(to route: UnionType) {
        print("CInterceptor didNavigate \(route)")
    }
    
    func didFailToNavigate(to route: UnionType?, error: any Error) {
        print("CInterceptor didFailToNavigate \(String(describing: route)), error: \(error.localizedDescription)")
    }
}
